// miniprogram/pages/index.js
Page({

  data: {
    allOfBook: [{
      'imgsrc': 'http://qiniu.xdstudy.com/papaya/cover_1488423128.jpg',
      'title': '五年级下册',
      'mulu': [{
        '62': 'Lesson 1 May I speak to Mary?'
      }, {
        '63': "Lesson 2 We mustn't cross the street now"
      }, {
        '64': 'Lesson 3 How many pupils are there?'
      }, {
        '65': 'Lesson 4 Where do you live?'
      }, {
        '66': 'Lesson 5 What do you do?'
      }, {
        '67': 'Lesson 6 Revision'
      }, {
        '68': "Lesson 7 It's seven thirty-five"
      }, {
        '69': 'Lesson 8 What day is it today?'
      }, {
        '70': 'Lesson 9 Do you always have lunch at twelve?'
      }, {
        '71': 'Lesson 10 Does she always come before six thirty?'
      }, {
        '72': 'Lesson 11 Where do you usually get up?'
      }, {
        '73': 'Lesson 12 Revision'
      }]
    }, {
      'imgsrc': 'http://qiniu.xdstudy.com/papaya/cover_1488423114.jpg',
      'title': '五年级上册',
      'mulu': [{
        '50': 'Lesson 1 What is she doing?'
      }, {
        '51': "Lesson 2 Don't be late next time!"
      }, {
        '52': 'Lesson 3 A computer has a keyboard'
      }, {
        '53': 'Lesson 4 Does Jim like swimming?'
      }, {
        '54': 'Lesson 5 What does he like?'
      }, {
        '55': 'Lesson 6 Revision'
      }, {
        '56': 'Lesson 7 What would you like?'
      }, {
        '57': 'Lesson 8 Would you like some potatoes?'
      }, {
        '58': 'Lesson 9 How many cakes do you want?'
      }, {
        '59': 'Lesson 10 There is a horse under the tree'
      }, {
        '60': "Lesson 11 There isn't any bread in the fridge"
      }, {
        '61': 'Lesson 12 Revision'
      }]
    }, {
      'imgsrc': 'http://qiniu.xdstudy.com/papaya/cover_1488417235.jpg',
      'title': '四年级下册',
      'mulu': [{
        '38': 'Lesson 1 Whose watch is it?'
      }, {
        '39': 'Lesson 2 What colour are the trousers?'
      }, {
        '40': 'Lesson 3 They are in Class Three'
      }, {
        '41': 'Lesson 4 Where are you from?'
      }, {
        '42': 'Lesson 5 What are these?'
      }, {
        '43': 'Lesson 6 Revision'
      }, {
        '44': "Lesson 7 Let's go swimming,OK?"
      }, {
        '45': 'Lesson 8 Do you have a ruler?'
      }, {
        '46': 'Lesson 9 I like summer'
      }, {
        '47': 'Lesson 10 Are you washing your face?'
      }, {
        '48': 'Lesson 11 What are you doing?'
      }, {
        '49': 'Lesson 12 Revision'
      }]
    }, {
      'imgsrc': 'http://qiniu.xdstudy.com/papaya/cover_1488417223.jpg',
      'title': '四年级上册',
      'mulu': [{
        '26': 'Lesson 1 We can dance'
      }, {
        '27': "Lesson 2 What's one the desk?"
      }, {
        '28': 'Lesson 3 Is this your bag?'
      }, {
        '29': 'Lesson 4 Is he your brother?'
      }, {
        '30': 'Lesson 5 What can you see?'
      }, {
        '31': 'Lesson 6 Revision'
      }, {
        '32': 'Lesson 7 Is she a doctor or a nurse?'
      }, {
        '33': "Lesson 8 What's the time?"
      }, {
        '34': 'Lesson 9 How many horses can you see?'
      }, {
        '35': 'Lesson 10 Where is my dog?'
      }, {
        '36': "Lesson 11 What's this in English?"
      }, {
        '37': 'Lesson 12 Revision'
      }]
    }, {
      'imgsrc': 'http://qiniu.xdstudy.com/papaya/cover_1488417209.jpg',
      'title': '三年级下册',
      'mulu': [{
        '14': 'Lesson 1 I can help you'
      }, {
        '15': "Lesson 2 It's too short"
      }, {
        '16': 'Lesson 3 Is that a pig?'
      }, {
        '17': 'Lesson 4 Where is my doll?'
      }, {
        '18': "Lesson 5 Let's run a race"
      }, {
        '19': 'Lesson 6 Revision'
      }, {
        '20': 'Lesson 7 Can you make cakes?'
      }, {
        '21': 'Lesson 8 Who is he?'
      }, {
        '22': 'Lesson 9 I have a kite'
      }, {
        '23': "Lesson 10 It's cold"
      }, {
        '24': 'Lesson 11 Have some coke'
      }, {
        '25': 'Lesson 12 Revision'
      }]
    }, {
      'imgsrc': 'http://qiniu.xdstudy.com/papaya/cover_1488415216.jpg',
      'title': '三年级上册',
      'mulu': [{
        '2': 'Lesson 1 I am a cat '
      }, {
        '3': 'Lesson 2 Are you Mr Dog?'
      }, {
        '4': 'Lesson 3 Nice to meet you'
      }, {
        '5': "Lesson 4 Wha's your name?"
      }, {
        '6': 'Lesson 5 How old are you?'
      }, {
        '7': 'Lesson 6 Revision'
      }, {
        '8': 'Lesson 7 Is it a bird?'
      }, {
        '9': "Lesson 8 What's this?"
      }, {
        '10': 'Lesson 9 What colour is the cap?'
      }, {
        '11': 'Lesson 10 How are you?'
      }, {
        '12': 'Lesson 11 How do you do?'
      }, {
        '13': 'Lesson 12 Revision'
      }]
    }],
    queryIndex: -1,









  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {

  },
  jumpCourse: function(e) {
    let id = e.currentTarget.dataset.id;
    wx.navigateTo({
      url: 'courseInfo?' + 'id=' + id,
    })

  },
  // 展示目录
  showMulu: function(e) {
    // console.log(e.currentTarget.dataset.index);
    let index = e.currentTarget.dataset.index;
    // console.log(typeof(index));
    if (this.data.queryIndex == index) {
      this.setData({
        queryIndex: 0.1
      })
    } else {
      this.setData({
        queryIndex: index
      })
    }







  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function() {

  }
})